
import Vue from "vue"
import Vuex from "vuex"
Vue.use(Vuex)

// 持久化  
import createPersistedState from "vuex-persistedstate"
const store = new Vuex.Store({
  plugins: [createPersistedState()],
  state: {
    cartNum: 8,
    userInfo: null,
    city: null,
    cityList: [],
    cinemaList: []
  },
  mutations: {
    changeUserInfo(state, payload) {
      state.userInfo = payload
    },
    changeCity(state, payload) {
      state.city = payload
    },
    changeCityList(state, payload) {
      state.cityList = payload
    },
    changeCinemaList(state, payload) {
      state.cinemaList = payload
    }
  },
  actions: {

  }
})


export default store